package com.zh.enums;

import com.zh.service.ResponseCode;

public enum CommonResponseCode  implements ResponseCode {
    Success("10000", "|operation.success|", 0),
    ServerError("99990001", "|server.error|", 0),
    IllegalArgument("99990002", "\"%s", 1),
    NoPermission("403", "|no.permission|", 0),
    NeedRefreshToken("99990004", "|refresh.required|Token的TTL", 0),
    NotLogin("401", "|user.not.logged|", 0),
    ErrorPassword("409", "|pwd.error|", 0),
    NotFound("99990011", "|not.exist|", 0),
    AlreadyExists("99990012", "|already.exist|", 0),
    AlreadyLocked("99990021", "|locked|", 0),
    LockFailure("99990022", "|lock.exception|", 0),
    DbFailure("99990031", "|db.exception|", 0),
    NetworkFailure("99990032", "|network.exception|", 0),
    AdaptorFailure("99990033", "|external.api.exception|", 0),
    ServerShutDown("99990098", "|server.shutdown|", 0),
    ServerBusy("502", "|server.busy|", 0);

    private String code;
    private String script;
    private int args;

    private CommonResponseCode(String code, String script, int args) {
        this.code = code;
        this.script = script;
        this.args = args;
    }

    public String getCode() {
        return this.code;
    }

    public int getArgs() {
        return this.args;
    }

    public String getScript() {
        return this.script;
    }
}
